package com.handinfo.android.ui.window;

import java.io.DataInputStream;
import java.util.concurrent.CopyOnWriteArrayList;

import android.graphics.Bitmap;

import com.handinfo.android.DWGameManager;
import com.handinfo.android.core.graphics.DWFont;
import com.handinfo.android.core.resource.Resource;
import com.handinfo.android.game.GameMessage;
import com.handinfo.android.game.Role;
import com.handinfo.android.ui.IUIWindows;
import com.handinfo.android.ui.SimpleRole;
import com.handinfo.android.ui.UIWindows;
import com.handinfo.android.uicontrols.DWControlTools;
import com.handinfo.android.uicontrols.DWControlsManager;
import com.handinfo.android.uicontrols.DWListener;
import com.handinfo.android.uicontrols.controls.DWAnimationBox;
import com.handinfo.android.uicontrols.controls.DWBackground;
import com.handinfo.android.uicontrols.controls.DWButton;
import com.handinfo.android.uicontrols.controls.DWFrame;
import com.handinfo.android.uicontrols.controls.DWImageBox;
import com.handinfo.android.uicontrols.controls.DWLabel;
import com.handinfo.android.uicontrols.controls.DWListSubItem;
import com.handinfo.android.uicontrols.controls.DWListbox;
import com.handinfo.android.uicontrols.controls.DWPopMenu;
import com.handinfo.android.uicontrols.controls.DWTabControl;
import com.handinfo.android.uicontrols.controls.DWTabPage;
import com.handinfo.android.uicontrols.controls.DWTextbox;
import com.handinfo.android.uicontrols.controls.DWTitle;
import com.handinfo.android.utils.Tools;

public class UIRankWindow implements IUIWindows {
	Bitmap m_cr_xxbj = null; // /小小背景
	Bitmap m_cr_tc; // 退出叉键按钮的图片
	Bitmap m_cr_but = null; // /按钮点击前图片
	Bitmap m_cr_but_1 = null;// /按钮点击后抬起前图片

	Bitmap m_cr_first = null;
	Bitmap m_cr_second = null;
	Bitmap m_cr_third = null;
	Bitmap m_cr_tp_1 = null; // /点击标签前的图片
	Bitmap m_cr_tp_2 = null; // /点击标签后的图片

	Bitmap m_cr_fanye_1 = null; // /翻页左侧
	Bitmap m_cr_fanye_2 = null; // /翻页右侧
	Bitmap m_cr_tit;
	DWFrame m_rank_frame = null; // //画布
	DWTitle m_rank_tit;// ///标题
	DWImageBox m_tit_ima;
	DWBackground m_xbj_bg;// ////小背景
	DWBackground m_xxbj_bg_1[];// /小小背景1
	DWBackground m_xxbj_bg_2[];// /小小背景2
	DWBackground m_xxbj_bg_3[];// /小小背景3

	DWLabel m_textbox_1[];// //每个标签页下的标签的字 例如：名次
	DWLabel m_textbox_2[][][]; // //每个标签下面的textbox
	DWTextbox m_first_text_1;
	DWTextbox m_first_text_2[];
	// DWTextbox m_first_text_3[];
	DWTextbox m_second_text_1;
	DWTextbox m_second_text_2[];
	// DWTextbox m_second_text_3[];
	DWTextbox m_third_text_1;
	DWTextbox m_third_text_2[];
	// DWTextbox m_third_text_3[];
	DWTextbox m_fanye_text;
	DWLabel m_page_text_1[];// /翻页显示的前面的第几页的字
	DWLabel m_page_text_2[];// /后面总页数
	DWTextbox m_page_text_3[];
	DWImageBox m_fy_left; // //翻页左侧
	DWImageBox m_fy_right; // /翻页右侧
	DWImageBox m_tuichu_ima;
	DWImageBox m_tuichu_ima_1;
	DWImageBox m_first_ima;
	DWImageBox m_second_ima;
	DWImageBox m_third_ima;
	DWListbox m_listbox[];
	DWButton m_rank_but[];
	String m_zhiye[] = null;
	public CopyOnWriteArrayList<SimpleRole> m_rankList = null;// 缓存当前排行榜列表
	public SimpleRole[] m_superranks = null;// 前3名
	public int m_maxLine = 10;// 一页请求显示内容条数
	String m_mb = new String("试");
	public static final byte 等级 = 0;
	public static final byte 家族 = 1;
	public static final byte 财富 = 2;
	public static final byte 击杀 = 3;
	public static final byte 贡献 = 4;
	public static final byte 战功 = 5;
	public static final byte 社交 = 6;
	public static final byte 个人竞技 = 7;
	public static final byte 家族竞技 = 8;
	public static final byte 婚姻 = 9;
	public static final byte 战力 = 10;

	// //标签页按钮的名字数组
	String[] m_stringname_1 = new String[] { "等级", "战力", "家族", "财富", "击杀", "贡献", "战功", "社交", "个人竞技", "家族竞技", "婚姻" };
	// //每一个标签下的四个标签的内容都是什么的二维数组
	String[][] m_stringname_2 = new String[][] { 
			{ "名次", "姓名", "等级", "职业" }, 
			{ "名次", "姓名", "职业", "战力" },
			{ "名次", "家族", "等级", "人数" }, 
			{ "名次", "姓名", "金钱", "等级" },
			{ "名次", "姓名", "击杀", "等级" }, 
			{ "名次", "姓名", "家族", "贡献" }, 
			{ "名次", "姓名", "战功", "等级" }, 
			{ "名次", "姓名", "知名度", "等级" }, 
			{ "名次", "姓名", "等级", "积分" }, 
			{ "名次", "家族", "等级", "积分" },
			{ "名次", "郎君", "娘子", "恩爱值" } };
	DWTabControl m_tabcontrol = null;
	DWTabPage m_tp[] = null;

	Bitmap m_cr_vip[] = null;

	DWImageBox m_vip_ima[][];

	DWAnimationBox m_atb;
	DWLabel m_lb_1 = null;
	DWTextbox m_lb = null;
	int m_list_index;
	DWAnimationBox m_role_animation[] = null;
	Role m_role = null;
	// Bitmap m_cr_zhenying[] = new Bitmap[2];
	public DWImageBox m_first[];
	public DWImageBox m_second[];
	public DWImageBox m_third[];

	public void Rank(int index) {
		if (DWControlsManager.getInstance().contains(m_rank_frame)) {
			if (m_rank_frame != null) {
				DWControlsManager.getInstance().removeControl(m_rank_frame);
			}
		}
		// ////画布
		m_rank_frame = new DWFrame(DWFrame.FRAME_TYPE_FULL, true);
		m_rank_frame.setClickClose(false);
		// ///标题
		m_rank_tit = new DWTitle("", m_rank_frame);
		m_tit_ima = new DWImageBox(m_cr_tit);
		m_tit_ima.setNearAnchor(m_rank_tit, Tools.HCENTER_VCENTER, Tools.HCENTER_VCENTER, 0, 0);
		// /退出按钮
		m_tuichu_ima = new DWImageBox(m_cr_tc);
		m_tuichu_ima.setNearAnchorUn(m_rank_tit, Tools.RIGHT_VCENTER, Tools.RIGHT_VCENTER, 0, 0);
		m_tuichu_ima.setTouchZoomIn(40, 0);
		m_tuichu_ima.addListener(m_tuichu_lis);

		// ////小背景 左右20，上下15
		m_xbj_bg = new DWBackground(9 * m_cr_tp_1.getWidth() + 20, m_rank_frame.getShowHeight() - (m_rank_tit.getShowHeight() - 20) - m_cr_tp_2.getHeight() - 15);
		m_xbj_bg.setNearAnchor(m_rank_frame, Tools.LEFT_TOP, Tools.LEFT_TOP, (m_rank_frame.getShowWidth() - m_xbj_bg.getShowWidth()) / 2, m_cr_tp_2.getHeight() + (m_rank_tit.getShowHeight() - 20) + 8);

		// //tabcontrl 左右20，上下m_cr_tp_2的高度
		m_tabcontrol = new DWTabControl(m_cr_tp_1, m_cr_tp_2, m_cr_tp_1.getWidth() * 9 + 10, m_cr_tp_2.getHeight() + m_xbj_bg.getShowHeight() - 10);
		m_tabcontrol.setNearAnchor(m_xbj_bg, Tools.LEFT_TOP, Tools.LEFT_TOP, (m_xbj_bg.getShowWidth() - m_tabcontrol.getShowWidth()) / 2, -m_cr_tp_2.getHeight());
		m_tabcontrol.addListener(m_tabcontrol_lis);

		m_page_text_1 = new DWLabel[m_stringname_1.length];
		m_page_text_2 = new DWLabel[m_stringname_1.length];
		m_page_text_3 = new DWTextbox[m_stringname_1.length];
		m_first_text_2 = new DWTextbox[m_stringname_1.length];
		// m_first_text_3 = new DWTextbox[m_stringname_1.length];
		m_second_text_2 = new DWTextbox[m_stringname_1.length];
		m_third_text_2 = new DWTextbox[m_stringname_1.length];
		// m_second_text_3 = new DWTextbox[m_stringname_1.length];
		// m_third_text_3 = new DWTextbox[m_stringname_1.length];

		// /vip显示图片
		m_first = new DWImageBox[m_stringname_1.length];
		m_second = new DWImageBox[m_stringname_1.length];
		m_third = new DWImageBox[m_stringname_1.length];

		DWTextbox m_instead = new DWTextbox("只是作为取高度的textbox");
		float wide = DWFont.getDefaultFont().stringWidth("国");
		m_textbox_2 = new DWLabel[m_stringname_1.length][(m_tabcontrol.getShowHeight() - m_cr_tp_1.getHeight() - 10 - m_cr_fanye_1.getHeight() - m_instead.getShowHeight() - 5 - 10)
				/ m_lb.getShowHeight()][4];
		m_listbox = new DWListbox[m_stringname_1.length];
		m_vip_ima = new DWImageBox[m_stringname_1.length][(m_tabcontrol.getShowHeight() - m_cr_tp_1.getHeight() - 10 - m_cr_fanye_1.getHeight() - m_instead.getShowHeight() - 5 - 10)
				/ m_lb.getShowHeight()];
		m_tp = new DWTabPage[m_stringname_1.length];
		m_xxbj_bg_1 = new DWBackground[m_stringname_1.length];
		m_xxbj_bg_2 = new DWBackground[m_stringname_1.length];
		m_xxbj_bg_3 = new DWBackground[m_stringname_1.length];
		for (int m_tp_index = 0; m_tp_index < m_stringname_1.length; m_tp_index++) {
			m_tp[m_tp_index] = new DWTabPage();
			m_tp[m_tp_index].setName(m_stringname_1[m_tp_index]);
			if (m_tp_index == 8 || m_tp_index == 9) {
				m_tp[m_tp_index].setFont(DWFont.getFont(DWFont.getDefaultFont().getFontSize() * 90 / 100));
			}
			// //3个小小背景
			// 1
			m_xxbj_bg_1[m_tp_index] = new DWBackground(m_cr_xxbj, (m_xbj_bg.getShowWidth() - 2 * m_cr_fanye_1.getWidth() - 20) / 2, (m_xbj_bg.getShowHeight() - 20) / 2);
			m_xxbj_bg_1[m_tp_index].setNearAnchor(m_tp[m_tp_index], Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 10);
			m_tp[m_tp_index].addControls(m_xxbj_bg_1[m_tp_index]);

			m_first_ima = new DWImageBox(m_cr_first);
			m_first_ima.setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.LEFT_TOP, Tools.LEFT_TOP, 20, 10);
			m_tp[m_tp_index].addControls(m_first_ima);

			m_first_text_1 = new DWTextbox("<mark c=FFBB11>" + "冠军" + "</mark>");
			m_first_text_1.setNearAnchor(m_first_ima, Tools.LEFT_BOTTOM, Tools.RIGHT_BOTTOM, 20, 0);
			m_tp[m_tp_index].addControls(m_first_text_1);

			m_first_text_2[m_tp_index] = new DWTextbox("", m_xxbj_bg_1[m_tp_index].getShowWidth() / 2, m_xxbj_bg_1[m_tp_index].getShowHeight() - m_first_ima.getShowHeight() - 10 - 5);
			m_first_text_2[m_tp_index].setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.LEFT_BOTTOM, Tools.LEFT_BOTTOM, 3, 0);
			m_tp[m_tp_index].addControls(m_first_text_2[m_tp_index]);
			m_first_text_2[m_tp_index].setTouch(false);
			m_first_text_2[m_tp_index].addListener(m_first_text_2_lis);

			// m_first_text_3[m_tp_index] = new DWTextbox("Vip10");////vip
			// m_first_text_3[m_tp_index].setShow(false);
			// m_first_text_3[m_tp_index].setNearAnchor(m_xxbj_bg_1[m_tp_index],
			// Tools.RIGHT_TOP, Tools.RIGHT_TOP, 0, 0);
			// m_tp[m_tp_index].addControls(m_first_text_3[m_tp_index]);

			m_first[m_tp_index] = new DWImageBox(m_cr_vip[0]);
			m_first[m_tp_index].setShow(false);
			m_first[m_tp_index].setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.RIGHT_TOP, Tools.RIGHT_TOP, -10, 0);
			m_tp[m_tp_index].addControls(m_first[m_tp_index]);

			// 2
			m_xxbj_bg_2[m_tp_index] = new DWBackground(m_cr_xxbj, m_xxbj_bg_1[m_tp_index].getShowWidth() / 2, m_xxbj_bg_1[m_tp_index].getShowHeight());
			m_xxbj_bg_2[m_tp_index].setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.LEFT_TOP, Tools.LEFT_BOTTOM, 0, 0);
			m_tp[m_tp_index].addControls(m_xxbj_bg_2[m_tp_index]);

			m_second_ima = new DWImageBox(m_cr_third);
			m_second_ima.setNearAnchor(m_xxbj_bg_2[m_tp_index], Tools.LEFT_TOP, Tools.LEFT_TOP, 20, 10);
			m_tp[m_tp_index].addControls(m_second_ima);

			m_second_text_1 = new DWTextbox("<mark c=FFBB11>" + "亚军" + "</mark>");
			m_second_text_1.setNearAnchor(m_second_ima, Tools.LEFT_BOTTOM, Tools.RIGHT_BOTTOM, 10, 0);
			m_tp[m_tp_index].addControls(m_second_text_1);

			m_second_text_2[m_tp_index] = new DWTextbox("", m_xxbj_bg_2[m_tp_index].getShowWidth(), m_xxbj_bg_2[m_tp_index].getShowHeight() - m_second_ima.getShowHeight() - 10 - 5);
			m_second_text_2[m_tp_index].setNearAnchor(m_xxbj_bg_2[m_tp_index], Tools.LEFT_BOTTOM, Tools.LEFT_BOTTOM, 3, 0);
			m_tp[m_tp_index].addControls(m_second_text_2[m_tp_index]);
			m_second_text_2[m_tp_index].setTouch(false);
			m_second_text_2[m_tp_index].addListener(m_second_text_2_lis);

			// m_second_text_3[m_tp_index] = new DWTextbox("Vip10");////vip
			// m_second_text_3[m_tp_index].setShow(false);
			// m_second_text_3[m_tp_index].setNearAnchor(m_xxbj_bg_2[m_tp_index],
			// Tools.RIGHT_TOP, Tools.RIGHT_TOP, 0, 0);
			// m_tp[m_tp_index].addControls(m_second_text_3[m_tp_index]);

			m_second[m_tp_index] = new DWImageBox(m_cr_vip[0]);
			m_second[m_tp_index].setShow(false);
			m_second[m_tp_index].setNearAnchor(m_xxbj_bg_2[m_tp_index], Tools.RIGHT_TOP, Tools.RIGHT_TOP, -10, 0);
			m_tp[m_tp_index].addControls(m_second[m_tp_index]);

			// 3
			m_xxbj_bg_3[m_tp_index] = new DWBackground(m_cr_xxbj, m_xxbj_bg_1[m_tp_index].getShowWidth() - m_xxbj_bg_2[m_tp_index].getShowWidth(), m_xxbj_bg_1[m_tp_index].getShowHeight());
			m_xxbj_bg_3[m_tp_index].setNearAnchor(m_xxbj_bg_2[m_tp_index], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
			m_tp[m_tp_index].addControls(m_xxbj_bg_3[m_tp_index]);

			m_third_ima = new DWImageBox(m_cr_second);
			m_third_ima.setNearAnchor(m_xxbj_bg_3[m_tp_index], Tools.LEFT_TOP, Tools.LEFT_TOP, 20, 10);
			m_tp[m_tp_index].addControls(m_third_ima);

			m_third_text_1 = new DWTextbox("<mark c=FFBB11>" + "季军" + "</mark>");
			m_third_text_1.setNearAnchor(m_third_ima, Tools.LEFT_BOTTOM, Tools.RIGHT_BOTTOM, 10, 0);
			m_tp[m_tp_index].addControls(m_third_text_1);

			m_third_text_2[m_tp_index] = new DWTextbox("", m_xxbj_bg_3[m_tp_index].getShowWidth(), m_xxbj_bg_3[m_tp_index].getShowHeight() - m_third_ima.getShowHeight() - 10 - 5);
			m_third_text_2[m_tp_index].setNearAnchor(m_xxbj_bg_3[m_tp_index], Tools.LEFT_BOTTOM, Tools.LEFT_BOTTOM, 3, 0);
			m_tp[m_tp_index].addControls(m_third_text_2[m_tp_index]);
			m_third_text_2[m_tp_index].setTouch(false);
			m_third_text_2[m_tp_index].addListener(m_third_text_2_lis);

			// m_third_text_3[m_tp_index] = new DWTextbox("Vip10");////vip
			// m_third_text_3[m_tp_index].setShow(false);
			// m_third_text_3[m_tp_index].setNearAnchor(m_xxbj_bg_3[m_tp_index],
			// Tools.RIGHT_TOP, Tools.RIGHT_TOP, 0, 0);
			// m_tp[m_tp_index].addControls(m_third_text_3[m_tp_index]);

			m_third[m_tp_index] = new DWImageBox(m_cr_vip[0]);
			m_third[m_tp_index].setShow(false);
			m_third[m_tp_index].setNearAnchor(m_xxbj_bg_3[m_tp_index], Tools.RIGHT_TOP, Tools.RIGHT_TOP, -10, 0);
			m_tp[m_tp_index].addControls(m_third[m_tp_index]);

			if (m_tp_index != 2 && m_tp_index != 9 && m_tp_index != 10) {
				m_role_animation[m_tp_index] = new DWAnimationBox(m_role);
				m_role_animation[m_tp_index].setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.RIGHT_VCENTER, Tools.RIGHT_VCENTER, -50, 0);
				m_tp[m_tp_index].addControls(m_role_animation[m_tp_index]);
				m_role_animation[m_tp_index].addListener(m_lis);
			}

			// //右面10，上下10
			m_textbox_1 = new DWLabel[4];
			for (int m_label_index = 0; m_label_index < 4; m_label_index++) {
				m_textbox_1[m_label_index] = new DWLabel(m_stringname_2[m_tp_index][m_label_index]);
				m_textbox_1[m_label_index].setBackgroundColor(Tools.ALPHA);
				m_textbox_1[m_label_index].setTextColor(0xFFebe1c4);
				if (m_tp_index != 2 && m_tp_index != 5 && m_tp_index != 9 && m_tp_index != 10) {
					if (m_label_index == 0) {
						m_textbox_1[m_label_index].setShowWideHigh(
								(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10 - 6 * (int) wide) / 3 - m_cr_vip[0].getWidth(),
								m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 1) {
						m_textbox_1[m_label_index].setShowWideHigh(6 * (int) wide, m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 2) {
						m_textbox_1[m_label_index].setShowWideHigh(
								(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10 - 6 * (int) wide) / 3,
								m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 3) {
						m_textbox_1[m_label_index].setShowWideHigh(
								(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10 - 6 * (int) wide) / 3,
								m_textbox_1[m_label_index].getShowHeight());
					}
					if (m_label_index == 0) {
						m_textbox_1[m_label_index].setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.LEFT_TOP, Tools.RIGHT_TOP, 10, 0);
					} else if (m_label_index == 1) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, m_cr_vip[0].getWidth(), 0);
					} else if (m_label_index == 2) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
					} else if (m_label_index == 3) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
					}
				} else if (m_tp_index == 5) {
					if (m_label_index == 0) {
						m_textbox_1[m_label_index].setShowWideHigh(
								(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10 - 12 * (int) wide) / 2 - m_cr_vip[0].getWidth(),
								m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 1) {
						m_textbox_1[m_label_index].setShowWideHigh(6 * (int) wide, m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 2) {
						m_textbox_1[m_label_index].setShowWideHigh(6 * (int) wide, m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 3) {
						m_textbox_1[m_label_index].setShowWideHigh(
								(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10 - 12 * (int) wide) / 2,
								m_textbox_1[m_label_index].getShowHeight());
					}
					if (m_label_index == 0) {
						m_textbox_1[m_label_index].setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.LEFT_TOP, Tools.RIGHT_TOP, 10, 0);
					} else if (m_label_index == 1) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, m_cr_vip[0].getWidth(), 0);
					} else if (m_label_index == 2) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
					} else if (m_label_index == 3) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
					}
				} else if (m_tp_index == 2 || m_tp_index == 9) {
					if (m_label_index == 1) {
						m_textbox_1[m_label_index].setShowWideHigh(6 * (int) wide, m_textbox_1[m_label_index].getShowHeight());
					} else {
						m_textbox_1[m_label_index].setShowWideHigh(
								(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10 - 6 * (int) wide) / 3,
								m_textbox_1[m_label_index].getShowHeight());
					}
					m_textbox_1[m_label_index].setName(m_stringname_2[m_tp_index][m_label_index]);
					if (m_label_index == 0) {
						m_textbox_1[m_label_index].setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.LEFT_TOP, Tools.RIGHT_TOP, 10, 0);
					} else {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
					}
				} else if (m_tp_index == 10) {
					if (m_label_index == 0) {
						m_textbox_1[m_label_index].setShowWideHigh(
								(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10 - 12 * (int) wide) / 2,
								m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 1) {
						m_textbox_1[m_label_index].setShowWideHigh(6 * (int) wide, m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 2) {
						m_textbox_1[m_label_index].setShowWideHigh(6 * (int) wide, m_textbox_1[m_label_index].getShowHeight());
					} else if (m_label_index == 3) {
						m_textbox_1[m_label_index].setShowWideHigh(
								(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10 - 12 * (int) wide) / 2,
								m_textbox_1[m_label_index].getShowHeight());
					}
					if (m_label_index == 0) {
						m_textbox_1[m_label_index].setNearAnchor(m_xxbj_bg_1[m_tp_index], Tools.LEFT_TOP, Tools.RIGHT_TOP, 10, 0);
					} else if (m_label_index == 1) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
					} else if (m_label_index == 2) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
					} else if (m_label_index == 3) {
						m_textbox_1[m_label_index].setNearAnchor(m_textbox_1[m_label_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
					}
				}
				m_tp[m_tp_index].addControls(m_textbox_1[m_label_index]);
			}
			m_listbox[m_tp_index] = new DWListbox(m_tabcontrol.getShowWidth() - m_xxbj_bg_1[m_tp_index].getShowWidth() - 10, m_tabcontrol.getShowHeight() - m_cr_tp_1.getHeight() - 10
					- m_cr_fanye_1.getHeight() - m_textbox_1[0].getShowHeight() - 5 - 10);
			if (m_tp_index != 10) {
				m_listbox[m_tp_index].addListener(m_list_lsi);
				m_listbox[m_tp_index].setShowBackgroundRect(true);
			} else if (m_tp_index == 10) {
				m_listbox[m_tp_index].setShowBackgroundRect(false);
				m_first_text_2[10].setTouch(false);
				m_second_text_2[10].setTouch(false);
				m_third_text_2[10].setTouch(false);
			}
			m_listbox[m_tp_index].setNearAnchor(m_textbox_1[0], Tools.LEFT_TOP, Tools.LEFT_BOTTOM, 0, 5);
			m_tp[m_tp_index].addControls(m_listbox[m_tp_index]);

			m_page_text_3[m_tp_index] = new DWTextbox("/");
			m_page_text_3[m_tp_index].setNearAnchor(m_listbox[m_tp_index], Tools.HCENTER_TOP, Tools.HCENTER_BOTTOM, 0, (m_cr_fanye_1.getHeight() - m_page_text_3[m_tp_index].getShowHeight()) / 2 + 10);
			m_tp[m_tp_index].addControls(m_page_text_3[m_tp_index]);

			DWLabel m_l = new DWLabel("1");
			m_page_text_1[m_tp_index] = new DWLabel("1");
			m_page_text_1[m_tp_index].setShowWideHigh(4 * m_l.getShowWidth(), m_page_text_1[m_tp_index].getShowHeight());
			m_page_text_1[m_tp_index].setBackgroundColor(Tools.ALPHA);
			m_page_text_1[m_tp_index].setNearAnchor(m_page_text_3[m_tp_index], Tools.RIGHT_VCENTER, Tools.LEFT_VCENTER, 0, 0);
			m_tp[m_tp_index].addControls(m_page_text_1[m_tp_index]);

			m_page_text_2[m_tp_index] = new DWLabel("1");
			m_page_text_2[m_tp_index].setBackgroundColor(Tools.ALPHA);
			m_page_text_2[m_tp_index].setNearAnchor(m_page_text_3[m_tp_index], Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 0, 0);
			m_page_text_2[m_tp_index].setShowWideHigh(4 * m_l.getShowWidth(), m_page_text_1[m_tp_index].getShowHeight());
			m_tp[m_tp_index].addControls(m_page_text_2[m_tp_index]);

			m_fy_left = new DWImageBox(m_cr_fanye_1);
			m_fy_left.setNearAnchor(m_page_text_1[m_tp_index], Tools.RIGHT_VCENTER, Tools.LEFT_VCENTER, -5, 0);
			m_fy_left.addListener(m_fy_left_lis);
			m_fy_left.setTouchZoomIn(20, 10);
			m_tp[m_tp_index].addControls(m_fy_left);

			m_fy_right = new DWImageBox(m_cr_fanye_2);
			m_fy_right.setNearAnchor(m_page_text_2[m_tp_index], Tools.LEFT_VCENTER, Tools.RIGHT_VCENTER, 5, 0);
			m_fy_right.addListener(m_fy_right_lis);
			m_fy_right.setTouchZoomIn(20, 10);
			m_tp[m_tp_index].addControls(m_fy_right);

			for (int m_lsi_index = 0; m_lsi_index < m_listbox[m_tp_index].getShowHeight() / m_lb.getShowHeight(); m_lsi_index++) {
				DWListSubItem m_lsi = new DWListSubItem();
				m_lsi.setAutoWideHigh(false);
				m_lsi.setShowWideHigh(m_listbox[m_tp_index].getShowWidth(), m_lb.getShowHeight());
				for (int m_textbox_index = 0; m_textbox_index < 4; m_textbox_index++) {
					if (m_tp_index != 2 && m_tp_index != 5 && m_tp_index != 9 && m_tp_index != 10) {
						if (m_textbox_index == 0) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh(
									(m_listbox[m_tp_index].getShowWidth() - 6 * (int) wide) / 3 - m_cr_vip[0].getWidth(),
									m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_lsi, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 0);
						} else if (m_textbox_index == 1) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh(6 * (int) wide, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(
									m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1],
									Tools.LEFT_TOP,
									Tools.RIGHT_TOP,
									m_cr_vip[0].getWidth(),
									0);
						} else if (m_textbox_index == 2) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh((m_listbox[m_tp_index].getShowWidth() - 6 * (int) wide) / 3, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						} else if (m_textbox_index == 3) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh((m_listbox[m_tp_index].getShowWidth() - 6 * (int) wide) / 3, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						}
					} else if (m_tp_index == 5) {
						if (m_textbox_index == 0) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh(
									(m_listbox[m_tp_index].getShowWidth() - 12 * (int) wide) / 2 - m_cr_vip[0].getWidth(),
									m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_lsi, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 0);
						} else if (m_textbox_index == 1) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh(6 * (int) wide, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(
									m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1],
									Tools.LEFT_TOP,
									Tools.RIGHT_TOP,
									m_cr_vip[0].getWidth(),
									0);
						} else if (m_textbox_index == 2) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh(6 * (int) wide, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						} else if (m_textbox_index == 3) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh((m_listbox[m_tp_index].getShowWidth() - 12 * (int) wide) / 2, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						}
					} else if (m_tp_index == 2 || m_tp_index == 9) {
						if (m_textbox_index == 0) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh((m_listbox[m_tp_index].getShowWidth() - 6 * (int) wide) / 3, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_lsi, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 0);
						} else if (m_textbox_index == 1) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh(6 * (int) wide, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						} else {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh((m_listbox[m_tp_index].getShowWidth() - 6 * (int) wide) / 3, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						}
					} else if (m_tp_index == 10) {
						if (m_textbox_index == 0) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh((m_listbox[m_tp_index].getShowWidth() - 12 * (int) wide) / 2, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_lsi, Tools.LEFT_TOP, Tools.LEFT_TOP, 0, 0);
						} else if (m_textbox_index == 1) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh(6 * (int) wide, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						} else if (m_textbox_index == 2) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh(6 * (int) wide, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						} else if (m_textbox_index == 3) {
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index] = new DWLabel("");
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setShowWideHigh((m_listbox[m_tp_index].getShowWidth() - 12 * (int) wide) / 2, m_lb.getShowHeight());
							m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index - 1], Tools.LEFT_TOP, Tools.RIGHT_TOP, 0, 0);
						}
					}
					m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index].setBackgroundColor(Tools.ALPHA);
					m_lsi.addControls(m_textbox_2[m_tp_index][m_lsi_index][m_textbox_index]);
				}
				m_vip_ima[m_tp_index][m_lsi_index] = new DWImageBox(m_cr_vip[0]);
				m_vip_ima[m_tp_index][m_lsi_index].setNearAnchor(m_textbox_2[m_tp_index][m_lsi_index][1], Tools.RIGHT_VCENTER, Tools.LEFT_VCENTER, 0, 0);
				m_vip_ima[m_tp_index][m_lsi_index].setShow(false);
				m_lsi.addControls(m_vip_ima[m_tp_index][m_lsi_index]);
				m_listbox[m_tp_index].addSubItem(m_lsi);
			}
			m_tabcontrol.addTabPage(m_tp[m_tp_index]);
		}
		m_tabcontrol.setSelectPage(index);
		m_rank_frame.addControl(m_rank_tit);
		m_rank_frame.addControl(m_tit_ima);
		m_rank_frame.addControl(m_tuichu_ima);
		m_rank_frame.addControl(m_xbj_bg);
		m_rank_frame.addControl(m_tabcontrol);
		DWControlsManager.getInstance().addControl(m_rank_frame);
		DWGameManager.getInstance().getSendMessage().sendRankingList((byte) index, (short) 0, (short) (m_listbox[0].getShowHeight() / m_lb.getShowHeight()));
		Tools.debugPrintln("发送第0页" + "每一页的个数：" + (short) (m_listbox[0].getShowHeight() / m_lb.getShowHeight()));
	}

	private DWListener m_tuichu_lis = new DWListener() {

		public void OnDoubleClick() {
		}

		public void OnClick() {
			close((byte) 0);
		}
	};

	public void init() {
		// 加载图片
		m_cr_xxbj = UIWindows.createImage("/img/newui/beibaobj_1.gnp"); // /小背景
		m_cr_tit = UIWindows.createImage("/img/newui/paihaungbang_1.gnp");
		m_cr_tp_1 = UIWindows.createImage("/img/newui/biaoqianye_1.gnp");// 点击前图片
		m_cr_tp_2 = UIWindows.createImage("/img/newui/biaoqianye_2.gnp");// 点击后图片

		m_cr_but = UIWindows.createImage("/img/newui/anniu_6.gnp"); // ///按钮的图片
		m_cr_but_1 = UIWindows.createImage("/img/newui/anniu_6ax.gnp"); // ///按下按钮的图片

		m_cr_fanye_1 = UIWindows.createImage("/img/newui/haoyoufyan_2.gnp"); // /翻页左侧
		m_cr_fanye_2 = UIWindows.createImage("/img/newui/haoyoufyan_1.gnp"); // /翻页右侧
		m_cr_tc = UIWindows.createImage("/img/newui/fanhuianniu_1.gnp"); // 退出叉键按钮的图片

		m_cr_first = UIWindows.createImage("/img/newui/paimingwg_3.gnp"); // 冠军
		m_cr_second = UIWindows.createImage("/img/newui/paimingwg_1.gnp");// 季军
		m_cr_third = UIWindows.createImage("/img/newui/paimingwg_2.gnp");// /亚军

		m_cr_vip = new Bitmap[6];
		m_cr_vip[0] = UIWindows.createImage("/img/newui/vip_1.gnp");
		m_cr_vip[1] = UIWindows.createImage("/img/newui/vip_2.gnp");
		m_cr_vip[2] = UIWindows.createImage("/img/newui/vip_3.gnp");
		m_cr_vip[3] = UIWindows.createImage("/img/newui/vip_4.gnp");
		m_cr_vip[4] = UIWindows.createImage("/img/newui/vip_5.gnp");
		m_cr_vip[5] = UIWindows.createImage("/img/newui/vip_6.gnp");

		// m_cr_zhenying[0] = UIWindows.createImage("/img/newui/tianji_1.gnp");
		// m_cr_zhenying[1] = UIWindows.createImage("/img/newui/lingyin_1.gnp");

		m_lb_1 = new DWLabel("只取高度");
		m_lb = new DWTextbox("国", m_lb_1.getShowWidth(), m_lb_1.getShowHeight() + 5);
		m_role = new Role();
		m_role_animation = new DWAnimationBox[m_stringname_1.length];
		m_zhiye = new String[] { "剑客", "武者", "道士" };
		m_rankList = new CopyOnWriteArrayList<SimpleRole>();
		m_superranks = new SimpleRole[3];
	}

	public void open(byte index) {
		Rank(0);
	}

	public void close(byte index) {
		// 关闭窗口
		switch (index) {
			case 0:
				DWControlsManager.getInstance().removeControl(m_rank_frame);
				releaseRankList();
				releaseSuperRank();
				releaseFirstRole();
				break;
		}
	}

	public void dispose() {
		// 销毁图片

	}

	/** 清理第一名角色资源动画 */
	private void releaseFirstRole() {
		if (m_resource != null) {
			m_resource.clean();
		}
		m_firstRole = null;
	}

	/** 清理排行列表 */
	private void releaseRankList() {
		if (m_rankList != null && m_rankList.size() > 0) {
			m_rankList.clear();
		}
	}

	/** 清理排行前3名列表 */
	private void releaseSuperRank() {
		if (m_superranks != null) {
			for (int i = 0; i < m_superranks.length; i++) {
				m_superranks[i] = null;
			}
		}
	}

	/** 设置排行榜前3名数据 */
	private void setSuperRank(int curPage) {
		if (curPage == 0) {// 第一页时
			int size = m_rankList.size();
			for (int i = 0; i < size && i < m_superranks.length; i++) {
				m_superranks[i] = null;
				m_superranks[i] = m_rankList.get(i);

			}
		}
	}

	int m_index_page;

	/** 创建等级排行界面 */
	public void recvLevelRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				Tools.debugPrintln("当前页数：" + curPage);
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					Tools.debugPrintln("recvLevelRankingList i=" + i);
					SimpleRole role = new SimpleRole();
					role.m_gameID = dis.readLong(); // id
					role.m_name = dis.readUTF(); // 名字
					role.m_grade = dis.readInt(); // 等级
					role.m_vocations = dis.readByte();// 职业
					role.m_camp = dis.readByte();// 阵营
					Tools.debugPrintln("阵营：" + role.m_camp);
					role.m_vip = dis.readInt();// vip
					role.m_sex = dis.readByte();
					m_rankList.add(role);
					setFirstRole(dis, curPage, role.m_vocations, role.m_sex, i);
					role = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[等级].setName(Integer.toString(curPage + 1));
					m_page_text_2[等级].setName(Integer.toString(allPages));
				}
				if (m_rankList.size() >= 1) {
					m_role_animation[等级].setAnimation(m_firstRole);
				}
				Update_data(等级, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建家族排行界面 */

	public void recvFamilyRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				Tools.debugPrintln("个数：" + curSize);
				for (int i = 0; i < curSize; i++) {
					SimpleRole famliy = new SimpleRole();
					famliy.m_gameID = dis.readLong(); // id
					famliy.m_name = dis.readUTF(); // 名字
					Tools.debugPrintln("第" + i + "个的家族名字：" + famliy.m_name);
					famliy.m_grade = dis.readInt(); // 等级
					famliy.m_camp = dis.readByte();// 阵营
					famliy.m_person = dis.readInt();// 人数
					famliy.m_maxperson = dis.readInt();// 最大人数
					m_rankList.add(famliy);
					famliy = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[家族+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[家族+1].setName(Integer.toString(allPages));
				}
				Update_data(家族+1, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建财富排行界面 */
	public void recvWealthRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					SimpleRole role = new SimpleRole();
					role.m_gameID = dis.readLong(); // id
					role.m_name = dis.readUTF(); // 名字
					role.m_money = dis.readLong();// 金钱
					role.m_grade = dis.readInt(); // 等级
					role.m_camp = dis.readByte();// 阵营
					role.m_vip = dis.readInt();// vip
					role.m_vocations = dis.readByte();// 职业
					role.m_sex = dis.readByte();
					m_rankList.add(role);
					setFirstRole(dis, curPage, role.m_vocations, role.m_sex, i);
					role = null;

				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[财富+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[财富+1].setName(Integer.toString(allPages));
				}
				if (m_rankList.size() >= 1) {
					m_role_animation[财富+1].setAnimation(m_firstRole);
				}
				Update_data(财富+1, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建击杀排行界面 */
	public void recvKillRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					SimpleRole role = new SimpleRole();
					role.m_gameID = dis.readLong(); // id
					role.m_name = dis.readUTF(); // 名字
					role.m_kill = dis.readInt();// 击杀
					role.m_grade = dis.readInt(); // 等级
					role.m_camp = dis.readByte();// 阵营
					role.m_vip = dis.readInt();// vip
					role.m_vocations = dis.readByte();// 职业
					role.m_sex = dis.readByte();
					m_rankList.add(role);
					setFirstRole(dis, curPage, role.m_vocations, role.m_sex, i);
					role = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[击杀+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[击杀+1].setName(Integer.toString(allPages));
				}
				if (m_rankList.size() >= 1) {
					m_role_animation[击杀+1].setAnimation(m_firstRole);
				}
				Update_data(击杀+1, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建贡献排行界面 */
	public void recvContrbutionRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					SimpleRole role = new SimpleRole();
					role.m_gameID = dis.readLong(); // id
					role.m_name = dis.readUTF(); // 名字
					role.m_family = dis.readUTF();// 家族
					role.m_contrbution = dis.readLong();// 贡献值
					role.m_camp = dis.readByte();// 阵营
					role.m_vip = dis.readInt();// vip
					role.m_vocations = dis.readByte();// 职业
					role.m_sex = dis.readByte();
					m_rankList.add(role);
					setFirstRole(dis, curPage, role.m_vocations, role.m_sex, i);
					role = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[贡献+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[贡献+1].setName(Integer.toString(allPages));
				}
				if (m_rankList.size() >= 1) {
					m_role_animation[贡献+1].setAnimation(m_firstRole);
				}
				Update_data(贡献+1, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建战功排行界面 */
	public void recvMilitaryExploitsRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					SimpleRole role = new SimpleRole();
					role.m_gameID = dis.readLong(); // id
					role.m_name = dis.readUTF(); // 名字
					role.m_militaryexploits = dis.readLong();// 战功
					role.m_grade = dis.readInt(); // 等级
					role.m_camp = dis.readByte();// 阵营
					role.m_vip = dis.readInt();// vip
					role.m_vocations = dis.readByte();// 职业
					role.m_sex = dis.readByte();
					m_rankList.add(role);
					setFirstRole(dis, curPage, role.m_vocations, role.m_sex, i);
					role = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[战功+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[战功+1].setName(Integer.toString(allPages));
				}
				if (m_rankList.size() >= 1) {
					m_role_animation[战功+1].setAnimation(m_firstRole);
				}
				Tools.debugPrintln("战功个数长度：" + m_rankList.size());
				Update_data(战功+1, curPage);
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建社交排行界面 */
	public void recvSocialContactRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					SimpleRole role = new SimpleRole();
					role.m_gameID = dis.readLong(); // id
					role.m_name = dis.readUTF(); // 名字
					role.m_popularity = dis.readInt();// 知名度
					role.m_grade = dis.readInt(); // 等级
					role.m_camp = dis.readByte();// 阵营
					role.m_vip = dis.readInt();// vip
					role.m_vocations = dis.readByte();// 职业
					role.m_sex = dis.readByte();
					m_rankList.add(role);
					setFirstRole(dis, curPage, role.m_vocations, role.m_sex, i);
					role = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[社交+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[社交+1].setName(Integer.toString(allPages));
				}
				if (m_rankList.size() >= 1) {
					m_role_animation[社交+1].setAnimation(m_firstRole);
				}
				Update_data(社交+1, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建个人竞技排行界面 */
	public void recvIndividualSportsRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				// if(m_index_intead != null){
				// m_index_intead = null;
				// }
				// m_index_intead = new String[curSize];
				for (int i = 0; i < curSize; i++) {
					SimpleRole role = new SimpleRole();
					role.m_gameID = dis.readLong(); // id
					role.m_name = dis.readUTF(); // 名字
					role.m_integral = dis.readInt();// 积分
					// m_index_intead[i] = Tools.getMoney(role.m_integral);
					role.m_grade = dis.readInt(); // 等级
					role.m_camp = dis.readByte();// 阵营
					role.m_vip = dis.readInt();// vip
					role.m_vocations = dis.readByte();// 职业
					role.m_sex = dis.readByte();
					m_rankList.add(role);
					setFirstRole(dis, curPage, role.m_vocations, role.m_sex, i);
					role = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[个人竞技+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[个人竞技+1].setName(Integer.toString(allPages));
				}
				if (m_rankList.size() >= 1) {
					m_role_animation[个人竞技+1].setAnimation(m_firstRole);
				}
				Update_data(个人竞技+1, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建家族竞技排行界面 */
	public void recvFamilySportsRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					SimpleRole famliy = new SimpleRole();
					famliy.m_gameID = dis.readLong(); // id
					famliy.m_name = dis.readUTF(); // 家族名字
					famliy.m_grade = dis.readInt(); // 等级
					famliy.m_camp = dis.readByte(); // 阵营
					famliy.m_integral = dis.readInt();// 积分
					// m_index_intead[i] = Tools.getMoney(famliy.m_integral);
					m_rankList.add(famliy);
					famliy = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[家族竞技+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[家族竞技+1].setName(Integer.toString(allPages));
				}
				Update_data(家族竞技+1, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/** 创建婚姻排行界面 */
	public void recvMarriageRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					SimpleRole rloe = new SimpleRole();
					rloe.m_hasbandID = dis.readLong(); // 丈夫的id
					rloe.m_hasbadName = dis.readUTF(); // 丈夫名字
					rloe.m_wifeID = dis.readLong(); // 妻子的id
					rloe.m_wifeName = dis.readUTF(); // 妻子名字
					rloe.m_relationShip = dis.readInt();// 关系
					rloe.m_camp = dis.readByte();
					m_rankList.add(rloe);
					rloe = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[婚姻+1].setName(Integer.toString(curPage + 1));
					m_page_text_2[婚姻+1].setName(Integer.toString(allPages));
				}
				Update_data(婚姻+1, curPage);
				Tools.debugPrintln("m_rankList长度：" + m_rankList.size());
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}
	
	/** 创建战力排行界面 */
	public void recvZhanLiRankingList(DataInputStream dis) {
		try {
			DWGameManager.getInstance().getSendMessage().unlockNetwork(GameMessage.锁_排行);
			synchronized (this) {
				releaseRankList();
				int curPage = dis.readShort();// 当前页数
				int allPages = dis.readShort();// 总页数
				int curSize = dis.readShort();// 当前页内容数量
				for (int i = 0; i < curSize; i++) {
					SimpleRole role = new SimpleRole();
					role.m_gameID = dis.readLong(); // id
					role.m_name = dis.readUTF(); // 名字
					role.m_zhanli = dis.readInt();// 战力
					role.m_grade = dis.readInt(); // 等级
					role.m_camp = dis.readByte();// 阵营
					role.m_vip = dis.readInt();// vip
					role.m_vocations = dis.readByte();// 职业
					role.m_sex = dis.readByte();
					m_rankList.add(role);
					setFirstRole(dis, curPage, role.m_vocations, role.m_sex, i);
					role = null;
				}
				setSuperRank(curPage);
				m_index_page = curPage + 1;
				if (allPages != 0) {
					m_page_text_1[1].setName(Integer.toString(curPage + 1));
					m_page_text_2[1].setName(Integer.toString(allPages));
				}
				if (m_rankList.size() >= 1) {
					m_role_animation[1].setAnimation(m_firstRole);
				}
				Tools.debugPrintln("战功个数长度：" + m_rankList.size());
				Update_data(1, curPage);
			}
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	/**
	 * 获取前三名的人的阵营确定颜色、并且将名字更新
	 * 
	 * @param tabpage
	 * @param index
	 * @param camp
	 * @return
	 */
	public String getNameCampcolor(int tabpage, int index, byte camp) {
		if (tabpage != 10) {//原来为9
			if(camp ==1)
			{
				return "<mark c=f0480d>" + m_superranks[index].m_name + "</mark>" + DWControlTools.CHANGE_ROW;
			}
			else if( camp == 2)
			{
				return "<mark c=00fffc>" + m_superranks[index].m_name + "</mark>" + DWControlTools.CHANGE_ROW;
			}
		}
		return m_superranks[index].m_name + DWControlTools.CHANGE_ROW;
	}

	/**
	 * 婚姻特殊
	 * 
	 * @param index
	 * @return
	 */
	public String getManWife(int index) {
		return "<mark c=ddb956>" + "♂:" + "</mark>" + "<mark c=00fffc>" + m_superranks[index].m_hasbadName + "</mark>" + DWControlTools.CHANGE_ROW + "<mark c=FFC0CB>" + "♀:" + "</mark>"
				+ "<mark c=00fffc>" + m_superranks[index].m_wifeName + "</mark>" + DWControlTools.CHANGE_ROW + "恩爱值：" + Tools.getMoney(m_superranks[index].m_relationShip);
	}

	/**
	 * 前三名的左侧内容
	 * 
	 * @param tapindex
	 * @param index
	 * @return
	 */
	public String getTop(int tapindex, int index) {
		switch (tapindex) {
			case 0:
				return "等级：" + m_superranks[index].m_grade + "级" + DWControlTools.CHANGE_ROW + "职业：" + m_zhiye[m_superranks[index].m_vocations - 1];
			case 1:
				return "职业：" + m_zhiye[m_superranks[index].m_vocations - 1] + DWControlTools.CHANGE_ROW + "战力：" + m_superranks[index].m_zhanli;
			case 2:
				return "等级：" + m_superranks[index].m_grade + "级" + DWControlTools.CHANGE_ROW + "人数：" + m_superranks[index].m_person + "/" + m_superranks[index].m_maxperson;
			case 3:
				return "金钱：" + Tools.getMoney(m_superranks[index].m_money) + DWControlTools.CHANGE_ROW + "等级：" + m_superranks[index].m_grade + "级";
			case 4:
				return "击杀：" + Tools.getMoney(m_superranks[index].m_kill) + DWControlTools.CHANGE_ROW + "等级：" + m_superranks[index].m_grade + "级";
			case 5:
				return "家族：" + m_superranks[index].m_family + DWControlTools.CHANGE_ROW + "贡献：" + Tools.getMoney(m_superranks[index].m_contrbution);
			case 6:
				return "战功：" + Tools.getMoney(m_superranks[index].m_militaryexploits) + DWControlTools.CHANGE_ROW + "等级：" + m_superranks[index].m_grade + "级";
			case 7:
				return "知名度：" + m_superranks[index].m_popularity + DWControlTools.CHANGE_ROW + "等级：" + m_superranks[index].m_grade + "级";
			case 8:
			case 9:
				return "等级：" + m_superranks[index].m_grade + "级" + DWControlTools.CHANGE_ROW + "积分：" + Tools.getMoney(m_superranks[index].m_integral);
		}
		return null;
	}

	/**
	 * 
	 * 
	 * @param tapindex
	 * @param index
	 * @return
	 */
	/**
	 *  右侧的列表的第3列统一实现方法，参数是标签页、列表第几个
	 * @param tapindex
	 * @param index
	 * @return
	 */
	public String getListThree(int tapindex, int index) {
		switch(tapindex)
		{
			case 0:
			case 2:
			case 8:
			case 9:
				return m_rankList.get(index).m_grade + "";
			case 1:
				return m_zhiye[m_rankList.get(index).m_vocations - 1];
//				return String.valueOf(m_rankList.get(index).m_vocations);
			case 3:
				return Tools.getMoney(m_rankList.get(index).m_money);
			case 4:
				return Tools.getMoney(m_rankList.get(index).m_kill);
			case 5:
				return m_rankList.get(index).m_family;
			case 6:
				return Tools.getMoney(m_rankList.get(index).m_militaryexploits);
			case 7:
				return Tools.getMoney(m_rankList.get(index).m_popularity);
			case 10:
				return m_rankList.get(index).m_wifeName;
		}
		return null;
	}

	/**
	 * 右侧列表的第4列统一实现方法
	 */
	public String getListFour(int tapindex,int index,int row)
	{
		switch(tapindex)
		{
			case 0:
				return m_zhiye[m_rankList.get(index).m_vocations - 1];
			case 1:
				return Integer.toString(m_rankList.get(index).m_zhanli);
			case 2:
				return m_rankList.get(index).m_person + "/" + m_rankList.get(index).m_maxperson;
			case 3:
			case 4:
			case 6:
			case 7:
				return Integer.toString(m_rankList.get(index).m_grade);
			case 5:
				return Tools.getMoney(m_rankList.get(index).m_contrbution);
			case 8:
				return Tools.getMoney(m_rankList.get(index).m_integral);
			case 9:
				return Tools.getMoney(m_rankList.get(index).m_integral);
			case 10:
				return Tools.getMoney(m_rankList.get(index).m_relationShip);
		}
		return null;
	}
	/**
	 * 右侧列表换字号的统一方法
	 * 
	 */
	public DWFont getFontSize(int tapindex,int index,int row)
	{
		if (m_textbox_2[tapindex][index][row].m_contents != null && m_textbox_2[tapindex][index][row].m_contents.length > 1) {
			m_textbox_2[tapindex][index][row].setFont(DWFont.getFont(DWFont.getDefaultFont().getFontSize() * 80 / 100));
			m_textbox_2[tapindex][index][row].nameToContents();
		} else {
			m_textbox_2[tapindex][index][row].setFont(DWFont.getFont(DWFont.getDefaultFont().getFontSize()));
			m_textbox_2[tapindex][index][row].nameToContents();
		}
		return DWFont.getDefaultFont();
	}
	/**
	 * 右侧列表换颜色的统一方法
	 */
	public int getListColor(int tapindex,int index,int row)
	{
		if (m_rankList.get(index).m_camp == 2) {
			m_textbox_2[tapindex][index][row].setTextColor(0xFF00fffc);
		} else if (m_rankList.get(index).m_camp == 1) {
			m_textbox_2[tapindex][index][row].setTextColor(0xFFf0480d);
		}
		return Tools.WHITE;
	}
	/**
	 * 更新数据的通用方法
	 * 
	 * @param i
	 * @param now_page_index
	 */
	public void Update_data(int i, int now_page_index)// /i是第几个标签页，m_page_index是当前页数
	{
		if (!DWControlsManager.getInstance().contains(m_rank_frame)) {
			return;
		}
		if (m_rankList.size() > 0 && m_rankList != null) {
			if (m_index_page == 1) {
				int size = 0;
				if (m_rankList.size() > 3) {
					size = 3;
				} else if (m_rankList != null && m_rankList.size() > 0 && m_rankList.size() <= 3) {
					size = m_rankList.size();
				} else {
					return;
				}
				for (int k = 0; k < size; k++) {
					if (i != 2 && i != 9 && i != 10) {
						DWImageBox vip_image = k == 0 ? m_first[i] : (k == 1 ? m_second[i] : m_third[i]);
						if (m_superranks[k].m_vip > 0) {
							vip_image.setBackground(m_cr_vip[m_superranks[k].m_vip - 1], true);
							vip_image.setShow(true);
						} else {
							vip_image.setShow(false);
						}
					}
					DWTextbox textbox = k == 0 ? m_first_text_2[i] : (k == 1 ? m_second_text_2[i] : m_third_text_2[i]);
					if (i != 10) {
						textbox.setText(getNameCampcolor(i, k, m_superranks[k].m_camp) + getTop(i, k));
						textbox.setTouch(true);
					} else {
						textbox.setText(getManWife(k));
						textbox.setTouch(false);
					}
				}
			}
			for (int j = 0; j < m_rankList.size(); j++) {
				if (m_rankList.get(j) != null) {
					if (i != 2 && i != 9 && i != 10) {
						if (m_rankList.get(j).m_vip > 0) {
							m_vip_ima[i][j].setImage(m_cr_vip[m_rankList.get(j).m_vip - 1]);
							m_vip_ima[i][j].setShow(true);
						} else {
							m_vip_ima[i][j].setShow(false);
						}
					}

					for (int t = 0; t < 4; t++) {
						if (t == 0) {
							m_textbox_2[i][j][t].setName(Integer.toString(now_page_index * m_index_size + (j + 1)));
							Tools.debugPrintln("名次:" + now_page_index * m_index_size + (j + 1));
						} else if (t == 1) {
							if(i != 10)
							{
								m_textbox_2[i][j][t].setName(m_rankList.get(j).m_name);
							}
							else
							{
								m_textbox_2[i][j][t].setName(m_rankList.get(j).m_hasbadName);
							}
							getFontSize(i,j,t);
							getListColor(i,j,t);
						} else if (t == 2) {
							m_textbox_2[i][j][t].setName(getListThree(i, j));
							if(i == 5 || i == 10)
							{
								getFontSize(i,j,t);
							}
							if(i==10)
							{
								getListColor(i,j,t);
							}
						} else if (t == 3) {
							m_textbox_2[i][j][t].setName(getListFour(i, j, t));
						}
					}
				}
			}
			if (m_rankList.size() < m_index_size) {
				for (int m = m_rankList.size(); m < m_index_size; m++) {
					for (int n = 0; n < 4; n++) {
						m_textbox_2[i][m][n].setName("");
					}
					if(i != 2  && i != 9 && i != 10)
					{
						m_vip_ima[i][m].setShow(false);
					}
				}
			}
		}
	}










	////*****************************************************************************************************///
	/**
	 * 监听
	 */
	int m_index_size = 0;
	private DWListener m_tabcontrol_lis = new DWListener() {

		public void OnDoubleClick() {
		}

		public void OnClick() {
			if(m_tabcontrol.getPageIndex() >=2){
				DWGameManager.getInstance().getSendMessage()
				.sendRankingList((byte) (m_tabcontrol.getPageIndex()-1), (short) 0, (short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}else if(m_tabcontrol.getPageIndex() == 0){
				DWGameManager.getInstance().getSendMessage()
				.sendRankingList((byte) m_tabcontrol.getPageIndex(), (short) 0, (short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}else if(m_tabcontrol.getPageIndex() == 1){
				DWGameManager.getInstance().getSendMessage()
				.sendRankingList((byte) 战力, (short) 0, (short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}
		}
	};

	private DWListener m_fy_left_lis = new DWListener() {

		public void OnDoubleClick() {
		}

		public void OnClick() {
			int m_page_index = Integer.parseInt(m_page_text_1[m_tabcontrol.getPageIndex()].getName()) - 1;
			if (m_page_index < 1) {
				DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "当前页已是第一页。");
				return;
			}
			if(m_tabcontrol.getPageIndex() >= 2){
				DWGameManager
				.getInstance()
				.getSendMessage()
				.sendRankingList(
						(byte) (m_tabcontrol.getPageIndex()-1),
						(short) (Integer.parseInt(m_page_text_1[m_tabcontrol.getPageIndex()].getName()) - 2),
						(short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}else if(m_tabcontrol.getPageIndex() == 0){
				DWGameManager
				.getInstance()
				.getSendMessage()
				.sendRankingList(
						(byte) m_tabcontrol.getPageIndex(),
						(short) (Integer.parseInt(m_page_text_1[m_tabcontrol.getPageIndex()].getName()) - 2),
						(short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}else if(m_tabcontrol.getPageIndex() == 1){
				DWGameManager
				.getInstance()
				.getSendMessage()
				.sendRankingList(
						(byte) 战力,
						(short) (Integer.parseInt(m_page_text_1[m_tabcontrol.getPageIndex()].getName()) - 2),
						(short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}
			
		}
	};
	private DWListener m_fy_right_lis = new DWListener() {

		public void OnDoubleClick() {
		}

		public void OnClick() {
			int m_page_index_1 = Integer.parseInt(m_page_text_1[m_tabcontrol.getPageIndex()].getName()) + 1;
			int m_page_index_2 = Integer.parseInt(m_page_text_2[m_tabcontrol.getPageIndex()].getName());
			if (m_page_index_1 > m_page_index_2) {
				DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "当前页已是最后一页。");
				return;
			}
			if(m_tabcontrol.getPageIndex() >= 2){
				DWGameManager
				.getInstance()
				.getSendMessage()
				.sendRankingList(
						(byte) (m_tabcontrol.getPageIndex()-1),
						(short) (Integer.parseInt(m_page_text_1[m_tabcontrol.getPageIndex()].getName())),
						(short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}else if(m_tabcontrol.getPageIndex() == 0){
				DWGameManager
				.getInstance()
				.getSendMessage()
				.sendRankingList(
						(byte) m_tabcontrol.getPageIndex(),
						(short) (Integer.parseInt(m_page_text_1[m_tabcontrol.getPageIndex()].getName())),
						(short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}else if(m_tabcontrol.getPageIndex() == 1){
				DWGameManager
				.getInstance()
				.getSendMessage()
				.sendRankingList(
						(byte) 战力,
						(short) (Integer.parseInt(m_page_text_1[m_tabcontrol.getPageIndex()].getName())),
						(short) (m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight()));
				m_index_size = m_listbox[m_tabcontrol.getPageIndex()].getShowHeight() / m_lb.getShowHeight();
			}
			
		}
	};

	private DWListener m_first_text_2_lis = new DWListener() {

		public void OnDoubleClick() {
		}

		public void OnClick() {
			if (m_tabcontrol.getPageIndex() != 10) {
				if (m_tabcontrol.getPageIndex() != 2 && m_tabcontrol.getPageIndex() != 9) {
					if (m_first_text_2[m_tabcontrol.getPageIndex()].getText() != null && !m_first_text_2[m_tabcontrol.getPageIndex()].getText().equals("")) {
						final DWPopMenu m_pm_1 = new DWPopMenu(m_name_0, m_cr_but);
						m_pm_1.setDownImage(m_cr_but_1);
						DWControlsManager.getInstance().addControl(m_pm_1);
						m_pm_1.addListener(new DWListener() {

							public void OnDoubleClick() {
							}

							public void OnClick() {
								if (m_pm_1.getIndex() == 0) {
									if (m_superranks[0].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										DWGameManager.getInstance().getSendMessage().sendSeeOtherRoleInfo(m_superranks[0].m_gameID);
									} else if (m_superranks[0].m_gameID == DWGameManager.getInstance().m_role.m_gameId) {
										UIWindows.getInstance().m_rolestats.open((byte) 0);
									}
								} else if (m_pm_1.getIndex() == 1) {
									if (m_superranks[0].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										UIWindows.getInstance().m_liaotian.open((byte) 0);
										UIWindows.getInstance().m_liaotian.m_tabcontrol.setSelectPage(6);
										UIWindows.getInstance().m_liaotian.m_pindao_but.setName("私聊");
										UIWindows.getInstance().m_liaotian.m_inputbox.setText(m_superranks[0].m_name + ":");
										m_id_chuandi = m_superranks[0].m_gameID;
										UIWindows.getInstance().m_liaotian.ID(m_id_chuandi);
										m_name = m_superranks[0].m_name;
										UIWindows.getInstance().m_liaotian.Name(m_name);
									} else {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "抱歉，不能和自己聊天。");
									}
								} else if (m_pm_1.getIndex() == 2) {
									if (m_superranks[0].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										if (m_superranks[0].m_camp == DWGameManager.getInstance().m_role.m_faction) {
											DWGameManager.getInstance().getSendMessage().sendSocialAddForName(UISocial.SOCIAL_TYPE_FRIEND, m_superranks[0].m_name);
										} else {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "对方和您不在一个阵营，无法发送加好友。");
										}
									} else {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "抱歉，不能加自己为好友。");
									}
								}
								DWControlsManager.getInstance().removeControl(m_pm_1);
							}
						});
					}
				} else if (m_tabcontrol.getPageIndex() == 2 || m_tabcontrol.getPageIndex() == 9) {
					if (m_first_text_2[m_tabcontrol.getPageIndex()].getText() != null && !m_first_text_2[m_tabcontrol.getPageIndex()].getText().equals("")) {
						final DWPopMenu m_pm_2 = new DWPopMenu(m_name_1, m_cr_but);
						m_pm_2.setDownImage(m_cr_but_1);
						DWControlsManager.getInstance().addControl(m_pm_2);
						m_pm_2.addListener(new DWListener() {

							public void OnDoubleClick() {
							}

							public void OnClick() {
								if (m_pm_2.getIndex() == 0) {
									if (DWGameManager.getInstance().m_role.m_family_name == null || DWGameManager.getInstance().m_role.m_family_name.equals("")) {
										DWGameManager.getInstance().getSendMessage().sendFamilyApplyAdd(m_superranks[0].m_gameID);
									} else {
										if (DWGameManager.getInstance().m_role.m_family_name.equals(m_superranks[0].m_name)) {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "您已经在此家族中。");
										} else {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "您已经在其他家族中，不能再加入此家族。");
										}
									}
								} else if (m_pm_2.getIndex() == 1) {
									if (DWGameManager.getInstance().m_role.m_family_name != null || DWGameManager.getInstance().m_role.m_family_name.equals("")) {
										if (!m_superranks[0].m_name.equals(DWGameManager.getInstance().m_role.m_family_name)) {
											DWGameManager.getInstance().getSendMessage().sendFamilyOtherMessage(m_superranks[0].m_gameID);
										} else {
											DWGameManager.getInstance().getSendMessage().sendFamilyOwnMessage();
										}
									} else {
										DWGameManager.getInstance().getSendMessage().sendFamilyOtherMessage(m_superranks[0].m_gameID);
									}
								}
								DWControlsManager.getInstance().removeControl(m_pm_2);
							}
						});
					}
				}
			}
		}
	};
	private DWListener m_second_text_2_lis = new DWListener() {

		public void OnDoubleClick() {
		}

		public void OnClick() {
			if (m_tabcontrol.getPageIndex() != 10) {
				if (m_tabcontrol.getPageIndex() != 2 && m_tabcontrol.getPageIndex() != 9) {
					if (m_second_text_2[m_tabcontrol.getPageIndex()].getText() != null && !m_second_text_2[m_tabcontrol.getPageIndex()].getText().equals("")) {
						final DWPopMenu m_pm_1 = new DWPopMenu(m_name_0, m_cr_but);
						m_pm_1.setDownImage(m_cr_but_1);
						DWControlsManager.getInstance().addControl(m_pm_1);
						m_pm_1.addListener(new DWListener() {

							public void OnDoubleClick() {
							}

							public void OnClick() {
								if (m_pm_1.getIndex() == 0) {
									if (m_superranks[1].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										DWGameManager.getInstance().getSendMessage().sendSeeOtherRoleInfo(m_superranks[1].m_gameID);
									} else if (m_superranks[1].m_gameID == DWGameManager.getInstance().m_role.m_gameId) {
										UIWindows.getInstance().m_rolestats.open((byte) 0);
									}
								} else if (m_pm_1.getIndex() == 1) {
									if (m_superranks[1].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										UIWindows.getInstance().m_liaotian.open((byte) 0);
										UIWindows.getInstance().m_liaotian.m_tabcontrol.setSelectPage(6);
										UIWindows.getInstance().m_liaotian.m_pindao_but.setName("私聊");
										UIWindows.getInstance().m_liaotian.m_inputbox.setText(m_superranks[1].m_name + ":");
										m_id_chuandi = m_superranks[1].m_gameID;
										UIWindows.getInstance().m_liaotian.ID(m_id_chuandi);
										m_name = m_superranks[1].m_name;
										UIWindows.getInstance().m_liaotian.Name(m_name);
									} else {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "抱歉，不能和自己聊天。");
									}
								} else if (m_pm_1.getIndex() == 2) {
									if (m_superranks[1].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										if (m_superranks[1].m_camp == DWGameManager.getInstance().m_role.m_faction) {
											DWGameManager.getInstance().getSendMessage().sendSocialAddForName(UISocial.SOCIAL_TYPE_FRIEND, m_superranks[1].m_name);
										} else {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "对方和您不在一个阵营，无法发送加好友。");
										}
									} else {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "抱歉，不能加自己为好友。");
									}
								}
								DWControlsManager.getInstance().removeControl(m_pm_1);
							}
						});
					}
				} else if (m_tabcontrol.getPageIndex() == 2 || m_tabcontrol.getPageIndex() == 9) {
					if (m_second_text_2[m_tabcontrol.getPageIndex()].getText() != null && !m_second_text_2[m_tabcontrol.getPageIndex()].getText().equals("")) {
						final DWPopMenu m_pm_2 = new DWPopMenu(m_name_1, m_cr_but);
						m_pm_2.setDownImage(m_cr_but_1);
						DWControlsManager.getInstance().addControl(m_pm_2);
						m_pm_2.addListener(new DWListener() {

							public void OnDoubleClick() {
							}

							public void OnClick() {
								if (m_pm_2.getIndex() == 0) {
									if (DWGameManager.getInstance().m_role.m_family_name == null || DWGameManager.getInstance().m_role.m_family_name.equals("")) {
										DWGameManager.getInstance().getSendMessage().sendFamilyApplyAdd(m_superranks[1].m_gameID);
									} else {
										if (DWGameManager.getInstance().m_role.m_family_name.equals(m_superranks[1].m_name)) {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "您已经在此家族中。");
										} else {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "您已经在其他家族中，不能再加入此家族。");
										}
									}
								} else if (m_pm_2.getIndex() == 1) {
									if (DWGameManager.getInstance().m_role.m_family_name != null || DWGameManager.getInstance().m_role.m_family_name.equals("")) {
										if (!m_superranks[1].m_name.equals(DWGameManager.getInstance().m_role.m_family_name)) {
											DWGameManager.getInstance().getSendMessage().sendFamilyOtherMessage(m_superranks[1].m_gameID);
										} else {
											DWGameManager.getInstance().getSendMessage().sendFamilyOwnMessage();
										}
									} else {
										DWGameManager.getInstance().getSendMessage().sendFamilyOtherMessage(m_superranks[1].m_gameID);
									}
								}
								DWControlsManager.getInstance().removeControl(m_pm_2);
							}
						});
					}
				}
			}
		}
	};
	private DWListener m_third_text_2_lis = new DWListener() {

		public void OnDoubleClick() {
		}

		public void OnClick() {
			if (m_tabcontrol.getPageIndex() != 10) {
				if (m_tabcontrol.getPageIndex() != 2 && m_tabcontrol.getPageIndex() != 9) {
					if (m_third_text_2[m_tabcontrol.getPageIndex()].getText() != null && !m_third_text_2[m_tabcontrol.getPageIndex()].getText().equals("")) {
						final DWPopMenu m_pm_1 = new DWPopMenu(m_name_0, m_cr_but);
						m_pm_1.setDownImage(m_cr_but_1);
						DWControlsManager.getInstance().addControl(m_pm_1);
						m_pm_1.addListener(new DWListener() {

							public void OnDoubleClick() {
							}

							public void OnClick() {
								if (m_pm_1.getIndex() == 0) {
									if (m_superranks[2].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										DWGameManager.getInstance().getSendMessage().sendSeeOtherRoleInfo(m_superranks[2].m_gameID);
									} else if (m_superranks[2].m_gameID == DWGameManager.getInstance().m_role.m_gameId) {
										UIWindows.getInstance().m_rolestats.open((byte) 0);
									}
								} else if (m_pm_1.getIndex() == 1) {
									if (m_superranks[2].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										UIWindows.getInstance().m_liaotian.open((byte) 0);
										UIWindows.getInstance().m_liaotian.m_tabcontrol.setSelectPage(6);
										UIWindows.getInstance().m_liaotian.m_pindao_but.setName("私聊");
										UIWindows.getInstance().m_liaotian.m_inputbox.setText(m_superranks[2].m_name + ":");
										m_id_chuandi = m_superranks[2].m_gameID;
										UIWindows.getInstance().m_liaotian.ID(m_id_chuandi);
										m_name = m_superranks[2].m_name;
										UIWindows.getInstance().m_liaotian.Name(m_name);
									} else {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "抱歉，不能和自己聊天。");
									}
								} else if (m_pm_1.getIndex() == 2) {
									if (m_superranks[2].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
										if (m_superranks[2].m_camp == DWGameManager.getInstance().m_role.m_faction) {
											DWGameManager.getInstance().getSendMessage().sendSocialAddForName(UISocial.SOCIAL_TYPE_FRIEND, m_superranks[2].m_name);
										} else {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "对方和您不在一个阵营，无法发送加好友。");
										}
									} else {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "抱歉，不能加自己为好友。");
									}
								}
								DWControlsManager.getInstance().removeControl(m_pm_1);
							}
						});
					}
				} else if (m_tabcontrol.getPageIndex() == 2 || m_tabcontrol.getPageIndex() == 9) {
					if (m_third_text_2[m_tabcontrol.getPageIndex()].getText() != null && !m_third_text_2[m_tabcontrol.getPageIndex()].getText().equals("")) {
						final DWPopMenu m_pm_2 = new DWPopMenu(m_name_1, m_cr_but);
						m_pm_2.setDownImage(m_cr_but_1);
						DWControlsManager.getInstance().addControl(m_pm_2);
						m_pm_2.addListener(new DWListener() {

							public void OnDoubleClick() {
							}

							public void OnClick() {
								if (m_pm_2.getIndex() == 0) {
									if (DWGameManager.getInstance().m_role.m_family_name == null || DWGameManager.getInstance().m_role.m_family_name.equals("")) {
										DWGameManager.getInstance().getSendMessage().sendFamilyApplyAdd(m_superranks[2].m_gameID);
									} else {
										if (DWGameManager.getInstance().m_role.m_family_name.equals(m_superranks[2].m_name)) {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "您已经在此家族中。");
										} else {
											DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "您已经在其他家族中，不能再加入此家族。");
										}
									}
								} else if (m_pm_2.getIndex() == 1) {
									if (DWGameManager.getInstance().m_role.m_family_name != null || DWGameManager.getInstance().m_role.m_family_name.equals("")) {
										if (!m_superranks[2].m_name.equals(DWGameManager.getInstance().m_role.m_family_name)) {
											DWGameManager.getInstance().getSendMessage().sendFamilyOtherMessage(m_superranks[2].m_gameID);
										} else {
											DWGameManager.getInstance().getSendMessage().sendFamilyOwnMessage();
										}
									} else {
										DWGameManager.getInstance().getSendMessage().sendFamilyOtherMessage(m_superranks[2].m_gameID);
									}
								}
								DWControlsManager.getInstance().removeControl(m_pm_2);
							}
						});
					}
				}
			}
		}
	};
	private DWListener m_list_lsi = new DWListener() {

		public void OnDoubleClick() {
		}

		public void OnClick() {
			if(m_tabcontrol.getPageIndex() == 10){
				return;
			}
			if (m_tabcontrol.getPageIndex() != 2 && m_tabcontrol.getPageIndex() != 9) {
				if (m_textbox_2[m_tabcontrol.getPageIndex()][m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()][1].getName() != null
						&& !m_textbox_2[m_tabcontrol.getPageIndex()][m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()][1].getName().equals("")) {
					final DWPopMenu m_pm_1 = new DWPopMenu(m_name_0, m_cr_but);
					m_pm_1.setDownImage(m_cr_but_1);
					DWControlsManager.getInstance().addControl(m_pm_1);
					m_pm_1.addListener(new DWListener() {

						public void OnDoubleClick() {
						}

						public void OnClick() {
							if (m_pm_1.getIndex() == 0) {
								if (m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
									DWGameManager.getInstance().getSendMessage().sendSeeOtherRoleInfo(m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID);
								} else if (m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID == DWGameManager.getInstance().m_role.m_gameId) {
									UIWindows.getInstance().m_rolestats.open((byte) 0);
								}
							} else if (m_pm_1.getIndex() == 1) {
								if (m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
									UIWindows.getInstance().m_liaotian.open((byte) 0);
									UIWindows.getInstance().m_liaotian.m_tabcontrol.setSelectPage(6);
									UIWindows.getInstance().m_liaotian.m_pindao_but.setName("私聊");
									UIWindows.getInstance().m_liaotian.m_inputbox.setText(m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_name + ":");
									m_id_chuandi = m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID;
									UIWindows.getInstance().m_liaotian.ID(m_id_chuandi);
									m_name = m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_name;
									UIWindows.getInstance().m_liaotian.Name(m_name);
								} else {
									DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "抱歉，不能和自己聊天。");
								}
							} else if (m_pm_1.getIndex() == 2) {
								if (m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
									if (m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_camp == DWGameManager.getInstance().m_role.m_faction) {
										DWGameManager.getInstance().getSendMessage()
												.sendSocialAddForName(UISocial.SOCIAL_TYPE_FRIEND, m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_name);
									} else {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "对方和您不在一个阵营，无法发送加好友。");
									}
								} else {
									DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "抱歉，不能加自己为好友。");
								}
							}
							DWControlsManager.getInstance().removeControl(m_pm_1);
						}
					});
				}
			} else if (m_tabcontrol.getPageIndex() == 2 || m_tabcontrol.getPageIndex() == 9) {
				if (m_textbox_2[m_tabcontrol.getPageIndex()][m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()][1].getName() != null
						&& !m_textbox_2[m_tabcontrol.getPageIndex()][m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()][1].getName().equals("")) {
					final DWPopMenu popMenu = new DWPopMenu(m_name_1, m_cr_but);
					popMenu.setDownImage(m_cr_but_1);
					DWControlsManager.getInstance().addControl(popMenu);
					popMenu.addListener(new DWListener() {
						public void OnDoubleClick() {
						}

						public void OnClick() {
							if (popMenu.getIndex() == 0) {
								if (DWGameManager.getInstance().m_role.m_family_name == null || DWGameManager.getInstance().m_role.m_family_name.equals("")) {
									DWGameManager.getInstance().getSendMessage().sendFamilyApplyAdd(m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID);
								} else {
									if (DWGameManager.getInstance().m_role.m_family_name.equals(m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_name)) {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "您已经在此家族中。");
									} else {
										DWGameManager.getInstance().addSystemInfo(DWGameManager.SYSTEM_INFO_TYPE_B, "您已经在其他家族中，不能再加入此家族。");
									}
								}
							} else if (popMenu.getIndex() == 1) {
								if (DWGameManager.getInstance().m_role.m_family_name != null || DWGameManager.getInstance().m_role.m_family_name.equals("")) {
									if (!m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_name.equals(DWGameManager.getInstance().m_role.m_family_name)) {
										DWGameManager.getInstance().getSendMessage().sendFamilyOtherMessage(m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID);
									} else {
										DWGameManager.getInstance().getSendMessage().sendFamilyOwnMessage();
									}
								} else {
									DWGameManager.getInstance().getSendMessage().sendFamilyOtherMessage(m_rankList.get(m_listbox[m_tabcontrol.getPageIndex()].getTouchIndex()).m_gameID);
								}
							}
							DWControlsManager.getInstance().removeControl(popMenu);
						}
					});
				}
			}
		}
	};
	DWPopMenu m_pm_sigle;
	DWPopMenu m_pm_family;
	String m_name_0[] = new String[] { "查看", "私聊", "加好友" };
	String m_name_1[] = new String[] { "申请加入", "查看家族" };

	long m_id_chuandi = 0;
	String m_name = null;

	public String Get(String name) {
		return name;
	}

	public void logic() {
	}

	/** 排行榜第一名的角色形象相关 */
	public Resource m_resource = new Resource();
	public Role m_firstRole;

	public void setFirstRole(DataInputStream dis, int curpage, byte vocations, int sex, int k) {
		try {
			int size = 5;
			String[] urls = new String[size];
			for (int i = 0; i < size; i++) {
				urls[i] = dis.readUTF();
			}
			if (curpage == 0 && k == 0) {
				m_firstRole = new Role(m_resource);
				m_firstRole.m_vocation = vocations;
				m_firstRole.m_sex = (byte) sex;
				m_firstRole.initRoleAnims(m_resource, urls);
			}
			urls = null;
		} catch (Exception e) {
			Tools.debug(e);
		}
	}

	private DWListener m_lis = new DWListener() {
		public void OnDoubleClick() {
		}

		public void OnClick() {
			if (m_superranks[0].m_gameID != DWGameManager.getInstance().m_role.m_gameId) {
				DWGameManager.getInstance().getSendMessage().sendSeeOtherRoleInfo(m_superranks[0].m_gameID);
			} else if (m_superranks[0].m_gameID == DWGameManager.getInstance().m_role.m_gameId) {
				UIWindows.getInstance().m_rolestats.open((byte) 0);
			}

		}
	};
}
